﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using AppAcc.Views.DanhMuc;
using AppAcc.Views.FormDieuKien;
using AppAcc.Views.KTTH;
using AppAcc.Views.KTTSCD;
using AppAcc.Views.KTVTCCDC;
using AppAcc.Views.KTVTienMat;
using DevComponents.DotNetBar;

namespace AppAcc
{
    public partial class Main : DevComponents.DotNetBar.RibbonForm
    {
        public Main()
        {
            InitializeComponent();
        }
        private bool KiemTraTenTabConTrol(string name)
        {

            for (int i = 0; i <= superTabControl1.Tabs.Count - 1; i++)
            {
                if (superTabControl1.Tabs[i].Text == name)
                {
                    superTabControl1.SelectedTabIndex = i;
                    return true;
                }
            }

            return false;
        }
        private void bttChungTuThuTien_Click(object sender, EventArgs e)
        {
            var t = superTabControl1.CreateTab("Chứng từ thu tiền");
            var k = new FormPhieuThu();
            k.TopLevel = false;
            k.Dock = DockStyle.Fill;
            t.AttachedControl.Controls.Add(k);
            k.Show();
            superTabControl1.SelectedTabIndex = superTabControl1.Tabs.Count - 1;
        }

        private void bttChungTuChiTien_Click(object sender, EventArgs e)
        {
            var t = superTabControl1.CreateTab("Chứng từ chi tiền");
            var k = new FormPhieuChi();
            k.TopLevel = false;
            k.Dock = DockStyle.Fill;
            t.AttachedControl.Controls.Add(k);
            k.Show();
            superTabControl1.SelectedTabIndex = superTabControl1.Tabs.Count - 1;
        }

        private void bttSoQuyTienMat_Click(object sender, EventArgs e)
        {
            Views.FormDieuKien.FormDieuKienSoQuyTienMat f = new Views.FormDieuKien.FormDieuKienSoQuyTienMat();
            f.ShowDialog();
        }

        private void bttSoNhatKyThuTien_Click(object sender, EventArgs e)
        {
            Views.FormDieuKien.FormDieuKienNhatKyThuTienMat f = new Views.FormDieuKien.FormDieuKienNhatKyThuTienMat();
            f.ShowDialog();
        }

        private void bttSoNhatKyChiTien_Click(object sender, EventArgs e)
        {
            Views.FormDieuKien.FormDieuKienNhatKyChiTienMat f = new Views.FormDieuKien.FormDieuKienNhatKyChiTienMat();
            f.ShowDialog();
        }

        private void bttSoKTChiTietTienMat_Click(object sender, EventArgs e)
        {
            Views.FormDieuKien.FormDieuKienSoKeToanChiTietQuyTienMat f = new Views.FormDieuKien.FormDieuKienSoKeToanChiTietQuyTienMat();
            f.ShowDialog();
        }

        private void bttSoTienGuiNganHang_Click(object sender, EventArgs e)
        {

        }

        private void bttNhapKho_Click(object sender, EventArgs e)
        {
            var t = superTabControl1.CreateTab("Chứng từ nhập kho");
            var k = new FormChungTuNhapKhoHang();
            k.TopLevel = false;
            k.Dock = DockStyle.Fill;
            t.AttachedControl.Controls.Add(k);
            k.Show();
            superTabControl1.SelectedTabIndex = superTabControl1.Tabs.Count - 1;
        }

        private void bttXuatKho_Click(object sender, EventArgs e)
        {
            var t = superTabControl1.CreateTab("Chứng từ xuất kho");
            var k = new FormChungTuXuatKhoHang();
            k.TopLevel = false;
            k.Dock = DockStyle.Fill;
            t.AttachedControl.Controls.Add(k);
            k.Show();
            superTabControl1.SelectedTabIndex = superTabControl1.Tabs.Count - 1;
        }

        private void bttSoNhatKyNhapXuat_Click(object sender, EventArgs e)
        {
            Views.FormDieuKien.FormDieuKienSoTongHopNhapXuat f=new FormDieuKienSoTongHopNhapXuat();
            f.ShowDialog();
        }

        private void bttSoChiTietNhapXuat_Click(object sender, EventArgs e)
        {
            Views.FormDieuKien.FormDieuKienChiTietTongHopNhapXuat f = new FormDieuKienChiTietTongHopNhapXuat();
            f.ShowDialog();
        }

        private void bttBaoCaoTongHopNhapXuat_Click(object sender, EventArgs e)
        {

        }

        private void bttTheKho_Click(object sender, EventArgs e)
        {

        }

        private void bttTangTaiSan_Click(object sender, EventArgs e)
        {
            var t = superTabControl1.CreateTab("Chứng từ tăng tài sản");
            var k = new FormTangTaiSan();
            k.TopLevel = false;
            k.Dock = DockStyle.Fill;
            t.AttachedControl.Controls.Add(k);
            k.Show();
            superTabControl1.SelectedTabIndex = superTabControl1.Tabs.Count - 1;
        }

        private void bttGiamTaiSan_Click(object sender, EventArgs e)
        {
            var t = superTabControl1.CreateTab("Chứng từ giảm tài sản");
            var k = new FormGiamTaiSan();
            k.TopLevel = false;
            k.Dock = DockStyle.Fill;
            t.AttachedControl.Controls.Add(k);
            k.Show();
            superTabControl1.SelectedTabIndex = superTabControl1.Tabs.Count - 1;
        }

        private void bttTinhKhauHao_Click(object sender, EventArgs e)
        {

        }

        private void bttBangKeTaiSan_Click(object sender, EventArgs e)
        {

        }

        private void bttBangTinhHaoMon_Click(object sender, EventArgs e)
        {

        }

        private void bttTinhHinhTangGiamTSCD_Click(object sender, EventArgs e)
        {

        }

        private void bttTheTSCD_Click(object sender, EventArgs e)
        {

        }

        private void bttSoTSCD_Click(object sender, EventArgs e)
        {

        }

        private void bttTongHop_Click(object sender, EventArgs e)
        {
            var t = superTabControl1.CreateTab("Chứng từ tổng hợp");
            var k = new FormChungTuTongHop();
            k.TopLevel = false;
            k.Dock = DockStyle.Fill;
            t.AttachedControl.Controls.Add(k);
            k.Show();
            superTabControl1.SelectedTabIndex = superTabControl1.Tabs.Count - 1;
        }

        private void bttPhanBoChiPhi_Click(object sender, EventArgs e)
        {

        }

        private void bttKetChuyen_Click(object sender, EventArgs e)
        {

        }

        private void bttSoNhatKyChung_Click(object sender, EventArgs e)
        {

        }

        private void bttSoTongHopChiTietPhatSinh_Click(object sender, EventArgs e)
        {

        }

        private void bttSoTongHopChiTietTaiKhoan_Click(object sender, EventArgs e)
        {

        }

        private void bttSoChiTietPhatSinh_Click(object sender, EventArgs e)
        {

        }

        private void bttSoChiTietTaiKhoan_Click(object sender, EventArgs e)
        {

        }

        private void bttSoCaiTaiKhoan_Click(object sender, EventArgs e)
        {

        }

        private void bttSoPhatSinhTaiKhoan_Click(object sender, EventArgs e)
        {

        }

        private void bttGoToTaiSan_Click(object sender, EventArgs e)
        {
            var f = new FormTaiSan();
            f.ShowDialog();
        }

        
        private void bttKhoHang_Click(object sender, EventArgs e)
        {
            var t = superTabControl1.CreateTab("Kho hàng");
            var k = new Views.DanhMuc.FormLoaiHang();
            k.TopLevel = false;
            k.Dock = DockStyle.Fill;
            t.AttachedControl.Controls.Add(k);
            k.Show();
            superTabControl1.SelectedTabIndex = superTabControl1.Tabs.Count - 1;
        }

        private void bttThue_Click(object sender, EventArgs e)
        {
            var f = new FormNhomThueHangHoa();
            f.ShowDialog();
        }

        private void bttNhomDoiTac_Click(object sender, EventArgs e)
        {
            var f = new FormNhomDoiTac();
            f.ShowDialog();
        }

        private void bttDoiTac_Click(object sender, EventArgs e)
        {
            var f = new FormDoiTac();
            f.ShowDialog();
        }

        private void bttLoaiKho_Click(object sender, EventArgs e)
        {
            var f = new FormLoaiKho();
            f.ShowDialog();
        }

        private void bttQLTaiSan_Click(object sender, EventArgs e)
        {
            var f = new FormTaiSan();
            f.ShowDialog();
        }

        private void bttPhongBan_Click(object sender, EventArgs e)
        {
            var f = new FormPhongBan();
            f.ShowDialog();
        }

        private void bttNhomTaiSan_Click(object sender, EventArgs e)
        {
            var f = new FormNhomTaiSan();
            f.ShowDialog();
        }

        private void bttNhanVien_Click(object sender, EventArgs e)
        {
            var f = new FormNhanVien();
            f.ShowDialog();
        }

        private void bttTaiKhoan_Click(object sender, EventArgs e)
        {
            var f = new FormTaiKhoan();
            f.ShowDialog();
        }

        private void bttLoaiHangHoa_Click(object sender, EventArgs e)
        {
            var t = superTabControl1.CreateTab("Loại hàng hóa");
            var k = new FormLoaiHang();
            k.TopLevel = false;
            k.Dock = DockStyle.Fill;
            t.AttachedControl.Controls.Add(k);
            k.Show();
            superTabControl1.SelectedTabIndex = superTabControl1.Tabs.Count - 1;
            //var f = new FormHangHoa();
            //f.ShowDialog();
        }

        private void bttHangHoa_Click(object sender, EventArgs e)
        {
            var t = superTabControl1.CreateTab("Hàng hóa");
            var k = new FormHangHoa();
            k.TopLevel = false;
            k.Dock = DockStyle.Fill;
            t.AttachedControl.Controls.Add(k);
            k.Show();
            superTabControl1.SelectedTabIndex = superTabControl1.Tabs.Count - 1;
        }

        private void buttonItem14_Click(object sender, EventArgs e)
        {
            Views.FormDieuKien.FormDieuKienSoQuyTienMat f = new Views.FormDieuKien.FormDieuKienSoQuyTienMat();
            f.ShowDialog();
        }
    }
}